<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="<%=request.getContextPath()%>/"/>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <script src="static/js/jquery-2.1.1.min.js"></script>
    <%@include file="../layUI.jsp"%>

</head>
<body>
商品图像<table ><tr><td><img src="GoodsImage/${All.goodsImage} " style="width: 200px;height: 200px"></td></tr></table>
<form action="doGoods?action=goodsUpdate&goodsImage=${All.goodsImage}" method="post">
    <di id="d1"></di>
    商品id<input type="text" value="${All.id}" name="id" readonly>
    商品名称<input type="text" value="${All.goodsName}" name="goodsName" id="goodsName">
    小分类名称<select name="goodsSmalId" id="goodsSmalId">
    <c:forEach var="id" items="${goodsSmalId.keySet()}" varStatus="status">
        <option value='${id}'<c:if test="${id == All.goodsSmalId}">selected</c:if>>${goodsSmalId.get(id)}</option>
    </c:forEach>
<%--        <option value="${All.id}">${All.smallName}</option>--%>
    </select>
    商品的价格<input type="text" value="${All.goodsMoney}" name="goodsMoney" >
    商品的数量<input type="text" value="${All.goodsNumber}" name="goodsNumber" ><br>
    <%--需要修改的商品图像<input type="file"  name="goodsImage" onchange="checkImage(this.value)">--%>
    商品的运费<input type="text" value="${All.goodsCarriage}" name="goodsCarriage" >
    商品的类型<select name="goodsType" id="goodsType">
<%--    <option value="${All.goodsType}">${All.goodsType==0?'新品':'二手'}</option>--%>
    <option value="${0}">新品</option>
    <option value="${1}">二手</option>
</select>
    商家名称<select name="goodsSeId" id="goodsSeId">
    <c:forEach var="id" items="${goodsSeId.keySet()}" varStatus="status">
        <option value='${id}'<c:if test="${id == All.goodsSeId}">selected</c:if>>${goodsSeId.get(id)}</option>
    </c:forEach>
<%--    <option value="${All.seller.id}">${All.sellerName}</option>--%>
</select>
    商品的折扣<select name="goodsDiscId" id="goodsDiscId">
    <c:forEach var="id" items="${goodsDiscId.keySet()}" varStatus="status">
        <option value='${id}'<c:if test="${id == All.goodsDiscId}">selected</c:if>>${goodsDiscId.get(id)}</option>
    </c:forEach>
<%--    <option value="${All.discount.id}">${All.discRate}</option>--%>
</select>
    <input type="submit" value="修改完成" class="layui-btn" id="sub"  >
</form>
<%--<script src="/js/jquery-2.1.0.js"></script>--%>
<%--<script type="text/javascript">--%>
<%--    $(function () {--%>
<%--        $.getJSON("/doGoods", {"action": "optionS"}, getSeller);--%>
<%--        $.getJSON("/doGoods", {"action": "optionC"}, getSmall);--%>
<%--        $.getJSON("/doGoods", {"action": "optionD"}, getDisc);--%>
<%--    });--%>
<%--    function getSeller(data) {--%>
<%--        $("#goodsSeId").html("");--%>
<%--        $("#goodsSeId").append("<option value='0'>全部</option>");--%>
<%--        $.each(data, function (key, value) {--%>
<%--            // $("#goodsSeId").append("<option value='" + key + "'>" + value + "</option>");--%>
<%--            $("#goodsSeId").append("<option value='" + key + "' <c:if test='${All.goodsSeId} == " + key"'>selected</c:if> " + value + "</option>");--%>
<%--        });--%>
<%--    }--%>
<%--    function getSmall(data) {--%>
<%--        $("#goodsSmalId").html("");--%>
<%--        $("#goodsSmalId").append("<option value='0'>全部</option>");--%>
<%--        $.each(data, function (key, value) {--%>
<%--            $("#goodsSmalId").append("<option value='" + key + "'>" + value + "</option>");--%>
<%--        });--%>
<%--    }--%>
<%--    function getDisc(data) {--%>
<%--        $("#goodsDiscId").html("");--%>
<%--        $("#goodsDiscId").append("<option value='0'>全部</option>");--%>
<%--        $.each(data, function (key, value) {--%>
<%--            $("#goodsDiscId").append("<option value='" + key + "'>" + value + "</option>");--%>
<%--        });--%>
<%--    }--%>
<%--</script>--%>
</body>
</html>
